#include<bits/stdc++.h>
using namespace std;
int t,tt;
void solve(){
	int n;
	cin >> n;
	string s;
	cin >> s;
	int count = 0;
	for(int i = 0;i < n;i++){
		if(s[i] == '.'){
			count++;
			i += 2;
		}
	}
	cout << "Case " << t - tt << ": " << count << "\n";
}
int main(){
	cin >> t;
	tt = t;
	while(tt--) solve();
}